// 先排序后序 再暂存max 比较末端
function shot(arrs) {
    arrs.sort((a, b) => a[1] - b[1]);
    let count = 1;
    let max = arrs[0][1];
    for (let i = 1; i < arrs.length; i++) {
        if (arrs[i][0] > max) {
            count++
            max = arrs[i][1]
        }
    }
    return count
}

points = [[1, 2], [3, 4], [5, 6], [7, 8]]

console.log(shot(points))